package aftersale.api;

import aftersale.model.Discuss;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;
import java.util.Map;

/**
 * Created by xhz on 2016/11/1.
 * 评价管理api
 */
public interface DiscussApi {

    /**
     * 查询所有评价
     *
     * @param pageable
     * @return
     */
    public Page<Discuss> findDiscussPage(Pageable pageable);

    /**
     * 查询积分商城所有评价
     *
     * @param pageable
     * @return
     */
    public Page<Discuss> findDiscussPageScore(Pageable pageable);

    /**
     * 根据条件查询评价列表
     *
     * @param appraiserName
     * @param startDate
     * @param endDate
     * @param auditStatus
     * @param pageable
     * @return
     */
    public Page<Discuss> findDiscussByParam(String appraiserName, String startDate, String endDate, Integer auditStatus, Pageable pageable);


    /**
     * 根据条件查询评价列表(积分商城)
     *
     * @param appraiserName
     * @param startDate
     * @param endDate
     * @param auditStatus
     * @param pageable
     * @return
     */
    public Page<Discuss> findDiscussByParamScore(String appraiserName, String startDate, String endDate, Integer auditStatus, Pageable pageable);

    /**
     * 根据id查询评价内容
     *
     * @param id
     * @return
     */
    public Discuss findOneDiscuss(String id);

    /**
     * 保存评价回复
     *
     * @param id
     * @param status
     * @param content
     * @return
     */
    public Map saveApply(String id, Integer status, String content);

    /**
     * 评价
     *
     * @param discussList
     * @param isAll
     */
    void save(List<Discuss> discussList, Boolean isAll);

    public Page<Discuss> findDiscussByParamsPage(String goodsId, Pageable pageable);

    public Page<Discuss> findDiscussByValidFlagAndIsDeleteAndParamsPage(String goodsId, Integer validFlag,Boolean isDelete,  Pageable pageable);

    public String toString();


    public Boolean saveDisscuccs(List<Discuss> discussList);

}
